package cz.semjob.document.util;

import java.io.File;
import java.io.FilenameFilter;


public class FileUtil {
	
	private static FilenameFilter directoryFilter = new FilenameFilter() {
		  public boolean accept(File dir, String name) {
		    return new File(dir, name).isDirectory();
		  }
		};

	
	public static String changeSuffixOfFile(String fileName, String suffix) {
		int separatorIndex = fileName.lastIndexOf('.');
		String newFileName =fileName.substring(0, separatorIndex) + "." + suffix;
		return newFileName;
	}
	
	public static FilenameFilter getDirectoryFilenameFilter() {
		return directoryFilter;
	}

}
